﻿using System.Data.Entity.ModelConfiguration;
using RealtReview.DataAccess.Entities;

namespace RealtReview.DataAccess.Mappings
{
    public class CommentMap : EntityTypeConfiguration<Comment>
    {
        public CommentMap()
        {
            HasRequired(x => x.Review)
                .WithMany(x => x.Comments)
                .HasForeignKey(x => x.ReviewId)
                .WillCascadeOnDelete(true);
        }
    }
}